<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div>软件更新操作：</div>
  <div id="text"></div>
</body>
<script>
  let dom = document.getElementById('text')
  window.electron.ipcRenderer.on('main-to-renderer', (e, data) => {
    console.log('html:', data)
    let { name, msg } = data
    if (name == 'checking-for-update') { 
      dom.innerText = msg
    } else if (name == 'update-available') {
      dom.innerText = msg
    } else if (name == 'update-not-available') {
      dom.innerText = msg
      //不需要更新，接着关闭更新窗口，展示主窗口
      window.electron.ipcRenderer.invoke('renderer-to-main',{
        update: false
      })
    } else if (name == 'update-downloaded') {
      dom.innerText = msg
      //更新后的操作
      window.electron.ipcRenderer.invoke('renderer-to-main',{
        update:true
      })
    }
  })
</script>
</html>